package io.datajek.springbasics.movierecommendersystem.lesson11;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class ContentBasedFilter implements Filter {
    private Logger logger= LoggerFactory.getLogger(this.getClass());
    public ContentBasedFilter(){
       super();
       logger.info("In RecommenderImplementation setter method");
    }
    @PostConstruct
    public void postConstruct(){
        //将电影加载到缓存中
        logger.info("In RecommenderImplementation setter method");
    }
    @PreDestroy
    public void preDestroy() {
        //从缓存中删除电影
        logger.info("In RecommenderImplementation setter method");
    }
        //getRecommendations将第一部电影作为输入，并返回类似电影
    public String[] getRecommendations(String movie){

        //计算电影之间的相似度

        //返回电影推荐

        return new String[]{"Happy Feet","Tce Age","Shark Tale"};
    }
}
